package cn.lu.joke.entry;

import android.util.SparseArray;
import android.util.SparseIntArray;

import com.alibaba.fastjson.JSON;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Transient;

@Entity
public class ChatMessage {

    @Id(autoincrement = true)
    public Long _id;
    public long userId;
    public long sender_id;
    public long receiver_id;
    public long session_id;
    public int type;
    public String time;
    public String name;
    public String head_img;
    public String text;
    public String img_url;
    public String video_url;
    public String emoji;

    @Generated(hash = 2015006320)
    public ChatMessage(Long _id, long userId, long sender_id, long receiver_id,
            long session_id, int type, String time, String name, String head_img,
            String text, String img_url, String video_url, String emoji) {
        this._id = _id;
        this.userId = userId;
        this.sender_id = sender_id;
        this.receiver_id = receiver_id;
        this.session_id = session_id;
        this.type = type;
        this.time = time;
        this.name = name;
        this.head_img = head_img;
        this.text = text;
        this.img_url = img_url;
        this.video_url = video_url;
        this.emoji = emoji;
    }

    @Generated(hash = 2271208)
    public ChatMessage() {
    }

    public int[][] getEmoIntArray() {
        if (type == Message.MSG_TYPE_EMOJI && emoji != null) {
            return JSON.parseObject(emoji, int[][].class);
        }
        return null;
    }

    public Long get_id() {
        return this._id;
    }

    public void set_id(Long _id) {
        this._id = _id;
    }

    public long getUserId() {
        return this.userId;
    }

    public void setUserId(long userId) {
        this.userId = userId;
    }

    public long getSender_id() {
        return this.sender_id;
    }

    public void setSender_id(long sender_id) {
        this.sender_id = sender_id;
    }

    public long getReceiver_id() {
        return this.receiver_id;
    }

    public void setReceiver_id(long receiver_id) {
        this.receiver_id = receiver_id;
    }

    public long getSession_id() {
        return this.session_id;
    }

    public void setSession_id(long session_id) {
        this.session_id = session_id;
    }

    public int getType() {
        return this.type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public String getTime() {
        return this.time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getHead_img() {
        return this.head_img;
    }

    public void setHead_img(String head_img) {
        this.head_img = head_img;
    }

    public String getText() {
        return this.text;
    }

    public void setText(String text) {
        this.text = text;
    }

    public String getImg_url() {
        return this.img_url;
    }

    public void setImg_url(String img_url) {
        this.img_url = img_url;
    }

    public String getVideo_url() {
        return this.video_url;
    }

    public void setVideo_url(String video_url) {
        this.video_url = video_url;
    }

    public String getEmoji() {
        return this.emoji;
    }

    public void setEmoji(String emoji) {
        this.emoji = emoji;
    }
}
